
clear
clc

share_pc8plus = readtable('data_save_shares.csv');
share_pc8plus.Properties.VariableNames = {'pc8plus', 'year', 'quarter', 'declarant', 'share'};

load('Y_i_summary_pc8plus.mat');

Y_summary = join(Y_i_summary_pc8plus, share_pc8plus, 'Keys', {'declarant', 'year', 'quarter', 'pc8plus'});

writetable(Y_summary, 'Y_summary.csv', 'Delimiter',',','QuoteStrings',true);

